import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'  // Pinia持久化插件
// 引入useIntersectionObserver函数，用于判断图片是否进入视口区域
// import { useIntersectionObserver } from '@vueuse/core'  
// 引入图片懒加载插件
import { lazyPlugin } from './directives/index.js'
import { componentPlugin } from './components/index.js'

import App from './App.vue'
import router from './router'

// 引入common.scss
import '@/styles/common.scss'

const app = createApp(App)

const pinia = createPinia()
// 在Pinia身上注册持久化插件
pinia.use(piniaPluginPersistedstate)
app.use(pinia)
app.use(router)
app.use(lazyPlugin)
app.use(componentPlugin)

app.mount('#app')
